#pragma once

#include <queue>

class IBaseMessage;
enum  MessageID;

// Message Process function pointer
typedef void (*funcPtr)(MessageID msgID);

class MessageSystem
{
	std::queue<IBaseMessage*> m_Messages;

	funcPtr pFunc;

public:
	static MessageSystem* getInstance();

	void Send(IBaseMessage *msg) { m_Messages.push(msg); }
	void ProcessMessages();
	void ClearMessages();

	void setMessageProcFunc(funcPtr pFuncPtr) { pFunc = pFuncPtr; }

private:
	MessageSystem(void);
	MessageSystem(const MessageSystem&);
	virtual ~MessageSystem(void);
	MessageSystem& operator =(const MessageSystem&);
};

